package com.ruoyi.merchant.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.merchant.domain.dto.StatisticsDto;
import com.ruoyi.merchant.service.IStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/merchant/statistics")
public class StatisticsController extends BaseController {

    @Autowired
    private IStatisticsService statisticsService;

    @GetMapping("/initHome")
    public AjaxResult initHome() {
        return success(statisticsService.initTotal(new StatisticsDto()));
    }

    @GetMapping("/proportionOrder")
    public AjaxResult proportionOrder()
    {
        return success(statisticsService.proportionOrder());
    }

    @GetMapping("/proportionShopOrder")
    public AjaxResult proportionShopOrder() {
        return success(statisticsService.proportionShopOrder());
    }

    @GetMapping("/proportionOrderForDay")
    public AjaxResult proportionOrderForDay() {
        return success(statisticsService.proportionOrderForDay());
    }

    @GetMapping("/proportionShopOrderForDay")
    public AjaxResult proportionShopOrderForDay() {
        return success(statisticsService.proportionShopOrderForDay());
    }
}
